﻿using Avalonia.Controls;
using Avalonia.Input;
using MusicFluent.Models;
using MusicFluent.Views;
using NetEasyMusic.Lib.Models;

namespace MusicFluent.Controls;

public partial class PlaylistControl : UserControl
{
    public PlaylistControl()
    {
        InitializeComponent();
    }

    private void PlaylistTapped(object? sender, TappedEventArgs e)
    {
        if (DataContext is not PlaylistModel model) return;
        var main = ViewOpera.GetView<MainWindow>(this);
        if (main == null) return;
        main.TaskShow();
        var view = new MusicViews.PlaylistView(model, main.Cookie);
        main.Navigate(view);
        main.TaskShow();
    }
}